const Koa = require('koa')
const app = new Koa()

const main = (ctx) => {
    ctx.throw(500)
}

app.on('error',(error,ctx) => { // 监听后端错误
    console.log('server error',error);
})

app.use(main)
app.listen(3000, () => {
  console.log('项目已启动');
})